<template>
	<view >
		<view class="pageHeader" :style="{ color: color}">
			<view class="pageHeader_icon" v-if="show" >
				<text class="iconfont icon-zuojiantou" @tap="handleToBack"></text>
				<text>|</text>
				<text class="iconfont icon-home" @tap="handleToHome"></text>
			</view>
			<text>{{ title }}</text>
		</view>
		
	</view>
</template>

<script>
	export default {
		name:"pageHeader",
		data() {
			return {
				
			};
		},
		props:["title","show","color"],
		methods:{
			// 返回上一页面
			handleToBack(){
				uni.navigateBack();
			},
			// 返回到首页
			handleToHome(){
				uni.navigateTo({
					url: '/pages/index/index',
					success: res => {},
					fail: () => {},
					complete: () => {}
				});
			}
		}
	}
</script>

<style scoped>
	.pageHeader{
		width: 100%;
		height: 75px;
		font-size: 16px;
		line-height: 75px;
		text-align: center;
		color: black;
		position: relative;
	}
	
	.pageHeader_icon{
		position: absolute;
		left: 8px;
		top: 25px;
		width: 90px;
		height: 30px;
		background-color: rgba(0,0,0,0.4);
		color: white;
		line-height: 30px;
		border-radius: 20px;
		display: flex;
		justify-content: space-evenly;
	}
</style>
